package com.example.config;

import org.springframework.security.web.firewall.StrictHttpFirewall;
import org.springframework.security.web.firewall.HttpFirewall;

public class CustomHttpFirewall extends StrictHttpFirewall {
    public CustomHttpFirewall() {
        // 允许双斜杠
        setAllowSemicolon(true);
        setAllowBackSlash(true);
        setAllowUrlEncodedDoubleSlash(true);
        setAllowUrlEncodedPercent(true);
    }

    @Override
    public HttpFirewall.Request rejectBlocklistedUrls(HttpFirewall.Request request) {
        // 忽略特定的黑名单检查
        return super.rejectBlocklistedUrls(request);
    }
}